<div class="packet">
    <div class="m-subheader">
        <div class="row align-items-center">
            <div class="mr-auto col-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>总装质量数据清单</span>
                </h3>
            </div>
        </div>
    </div>
    <div class="m-content">
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__body">
                <div class="ui-g" style="margin-bottom: 20px;">
                    <div class="ui-g-7" style="display: flex;">
                        <div style="margin-right: 10px;display: flex;">
                            <span style="width: 50px;line-height: 30px;">型号：</span>
                            <input type="text" name="model" size="30" pInputText [(ngModel)]="model"
                                class="form-control" />
                        </div>
                        <div style="margin-right: 10px;display: flex;">
                            <span style="width: 50px;line-height: 30px;">发次：</span>
                            <input type="text" name="lotNo" size="30" pInputText [(ngModel)]="lotNo"
                                class="form-control" />
                        </div>
                        <div style="margin-right: 10px;display: flex;">
                            <span style="width: 50px;line-height: 30px;">图号：</span>
                            <input type="text" name="drawiingNo" size="30" pInputText [(ngModel)]="drawingNo"
                                class="form-control" />
                        </div>
                    </div>
                    <div class="ui-g-5">
                        <p-button label="搜索" (onClick)="getBopList()"></p-button>
                        <p-button label="重置" (onClick)="resetSearch()" style="margin-left: 30px;">
                        </p-button>
                        <p-button *ngIf="saveFlag && ('Pages.QualityManagement.5gImport' | permission)" label="5G数据包导入" (onClick)="openDialog(1)" style="margin-left: 30px;margin-right: 30px;">
                        </p-button>
                        <p-button *ngIf="saveFlag && ('Pages.QualityManagement.RangeImport' | permission)" label="靶场数据包导入" (onClick)="openDialog(2)">
                        </p-button>
                        <!-- <p-fileUpload  mode="basic" customUpload="true" chooseLabel="5G数据包导入"
                            [style]="{'position': 'absolute'}" (uploadHandler)="myUploader($event)"
                            [(files)]="uploadedFiles" multiple="false" auto="auto">
                        </p-fileUpload>
                        <p-fileUpload  mode="basic" customUpload="true" chooseLabel="靶场数据包导入"
                            [style]="{'position': 'absolute','margin-left': '172px'}" (uploadHandler)="rangeUploader($event)"
                            [(files)]="rangeFiles" multiple="false" auto="auto">
                        </p-fileUpload> -->
                    </div>
                </div>
                <div class="row align-items-center">
                    <div class="primeng-datatable-container impT">
                        <p-table #dataTable [value]="primengTableHelper.records" (onLazyLoad)="getBopList($event)"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                            [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns">
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width: 140px">操作</th>
                                    <th style="width: 150px">序号</th>
                                    <th style="width: 150px">型号</th>
                                    <th style="width: 150px">发次</th>
                                    <th style="width: 150px">名称</th>
                                    <th style="width: 150px">图号</th>
                                    <th style="width: 150px">阶段标记</th>
                                    <th style="width: 150px">质量包状态</th>
                                    <th style="width: 80px">回传版本</th>
                                    <th style="width: 150px">火箭状态</th>
                                    <th style="width: 150px">维护人</th>
                                    <th style="width: 150px">维护日期</th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit" let-rowIndex="rowIndex">
                                <tr>
                                    <td style="width: 140px">
                                        <div class="btn-group dropdown" dropdown container="body">
                                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                                                <i class="fa fa-cog"></i><span class="caret"></span> 操作
                                            </button>
                                            <ul class="dropdown-menu" *dropdownMenu>
                                                <li>
                                                    <a *ngIf="'Pages.QualityManagement.BOPManagement' | permission" href="javascript:;" (click)="toBopTree(record)">BOP管理</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.QualityManagement.RangeExport' | permission" href="javascript:;" (click)="rangeExport(record)">靶场数据包导出</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.QualityManagement.ExportPackage' | permission" href="javascript:;" (click)="exportPhoto(record)">导出资料包</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.QualityManagement.ViewResume' | permission" href="javascript:;" (click)="lookResume(record)">查看履历</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.QualityManagement.PlaceOnFile' | permission" href="javascript:;" (click)="placeOnFile(record)">归档</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td style="width: 150px">{{rowIndex+1}}</td>
                                    <td style="width: 150px">{{record.model}}</td>
                                    <td style="width: 150px">{{record.lotNo}}</td>
                                    <td style="width: 150px">{{record.modelName}}</td>
                                    <td style="width: 150px">{{record.drawingNo}}</td>
                                    <td style="width: 150px">{{record.stageSign}}</td>
                                    <td style="width: 150px">{{record.qualityStatusDesc}}</td>
                                    <td style="width: 80px">{{record.version}}</td>
                                    <td style="width: 150px">{{record.rocketState}}</td>
                                    <td style="width: 150px">{{record.userName}}</td>
                                    <td style="width: 150px">{{record.lastModificationTime | momentFormat:'YYYY-MM-DD
                                        HH:mm:ss'}}</td>
                                </tr>
                            </ng-template>
                        </p-table>
                        <div class="primeng-paging-container">
                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                (onPageChange)="getBopList($event)"
                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                            </p-paginator>
                            <span class="total-records-count">
                                {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 查看履历 -->
    <app-show-resume #showResume [parentInfo]="rowdata"></app-show-resume>
    <!-- 新增BOP -->
    <createOrEditBopManageModal #createOrEditBopManageModal (modalSave)="getBopList()" [parentInfo]="rowdata">
    </createOrEditBopManageModal>
    <!-- 任务导出 -->
    <tsk-export #TskExportComponent [editData]="rowdata" (modalSave)="getBopList()"></tsk-export>
    <!-- 打开5G -->
    <p-dialog [style]="{width: '80%', minHeight:'300px',background:'#fff'}" [(header)]="exportInTitle"
        [(visible)]="exportIn" (onHide)="displayclose()" modal="modal" [responsive]="true">
        <div style="margin-right: 10px;display: flex;">
            <span style="width: 90px;line-height: 30px;">文件名称：</span>
            <input type="text" name="model" size="30" pInputText [(ngModel)]="fileName"
                class="form-control" />
        </div>
        <div class="modal-footer" style="justify-content: center;">
            <button pButton [disabled]="fileName == undefined" type="button" label="导入"
                (click)="alterCertificateByBusinessEv()" style="margin-left: 0.5rem"></button>
        </div>
    </p-dialog>
</div>